package com.ptu.ws;

import com.alibaba.fastjson.annotation.JSONField;

//  消息
public class Message {
    @JSONField(name = "type")
    private MessageType type;

    @JSONField(name = "toName")
    private String toName;

    @JSONField(name = "content")
    private String content;

    @JSONField(name = "sender")
    private String sender;

    public Message() {
    }

    public Message(MessageType type, String toName, String content, String sender) {
        this.type = type;
        this.toName = toName;
        this.content = content;
        this.sender = sender;
    }

    public MessageType getType() {
        return type;
    }

    public void setType(MessageType type) {
        this.type = type;
    }

    public String getToName() {
        return toName;
    }

    public void setToName(String toName) {
        this.toName = toName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    @Override
    public String toString() {
        return "Message{" +
                "type=" + type +
                ", toName='" + toName + '\'' +
                ", content='" + content + '\'' +
                ", sender='" + sender + '\'' +
                '}';
    }
}